# !/bin/sh

make

if [ $(lsmod | grep -c "hello") -gt 0 ]
then
	sudo rmmod hello
fi

sudo insmod hello.ko

sudo chmod 755 /sys/kernel/debug

echo "cat /sys/kernel/debug/eudyptula/id"
cat /sys/kernel/debug/eudyptula/id

echo

echo "echo -n nonsense > /sys/kernel/debug/eudyptula/id"
echo -n nonsense > /sys/kernel/debug/eudyptula/id

echo "echo -n 09b0d224b5bb > /sys/kernel/debug/eudyptula/id"
echo -n 09b0d224b5bb > /sys/kernel/debug/eudyptula/id

echo "cat /sys/kernel/debug/eudyptula/jiffies"
cat /sys/kernel/debug/eudyptula/jiffies
echo

echo "echo -n abcd > /sys/kernel/debug/eudyptula/foo"
echo -n abcd > /sys/kernel/debug/eudyptula/foo
echo "sudo echo -n abcd > /sys/kernel/debug/eudyptula/foo"
sudo sh -c "echo -n abcd > /sys/kernel/debug/eudyptula/foo"
echo "cat /sys/kernel/debug/eudyptula/foo"
cat /sys/kernel/debug/eudyptula/foo
echo

sudo rmmod hello
